Skip to content

Update fontsource integration according with the documentation#483

Open
cedric07 wants to merge 1 commit intomasterfrom
fix/font-source-integration
Open

Update fontsource integration according with the documentation#483
cedric07 wants to merge 1 commit intomasterfrom
fix/font-source-integration

Conversation

@cedric07
Copy link
Copy Markdown
Contributor

@cedric07 cedric07 commented Apr 7, 2026

Mise à jour de l'intégration de font source via l'utilitaire recommandé par la documentation. Font source a évolué entre temps.

Summary by Sourcery

Update font loading to use the recommended @fontsource-utils SCSS mixins for Poppins and adjust installation instructions accordingly.

Enhancements:

  • Switch font-face declarations to use shared @fontsource-utils SCSS mixins for both classic and variable fonts.

Build:

  • Add @fontsource-utils/scss as a project dependency for font management.

Note

Medium Risk
Moderate risk because it changes how @font-face rules are generated for Poppins, which can affect font loading, bundle output, and styling/CLS, though the change is localized to build-time SCSS.

Overview
Updates Fontsource integration to follow current docs by adding @fontsource-utils/scss and switching _fonts.scss to generate font faces via fontsource.faces($metadata: ... ) instead of calling the font package’s faces mixin directly.

Includes lockfile updates and refreshed inline usage examples for both classic and variable fonts to match the new approach.

Reviewed by Cursor Bugbot for commit 25af7fa. Bugbot is set up for automated code reviews on this repo. Configure here.

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai bot commented Apr 7, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates Fontsource integration to use the recommended @fontsource-utils SCSS mixins and adds the corresponding dependency, adjusting both documentation comments and Poppins font-face declarations accordingly.

File-Level Changes

Change Details Files
Switch font-face integration to use @fontsource-utils SCSS mixins and metadata-based API instead of direct package mixins.
  • Update SCSS documentation comments to show installing @fontsource-utils/scss alongside font packages
  • Change example classic and variable font usage to import fontsource-utils mixins and call fontsource.faces with font package metadata
  • Import @fontsource-utils SCSS mixins in the base fonts stylesheet
  • Replace direct Poppins.faces mixin usage with fontsource.faces calls passing Poppins.$metadata for normal and italic styles
src/scss/03-base/_fonts.scss
Add the @fontsource-utils/scss package dependency required by the new integration.
  • Declare @fontsource-utils/scss with version ^0.2.2 in package.json dependencies
  • Update yarn.lock to lock the new dependency and any transitive resolution changes
package.json
yarn.lock

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@cedric07 cedric07 requested a review from francoistibo April 7, 2026 12:10
Copy link
Copy Markdown

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • The SCSS @use paths reference ../../../node_modules/...; if your build tooling supports it, prefer using package-based imports (e.g. @use '@fontsource-utils/scss/src/mixins') to avoid brittle relative paths that may break if the directory structure changes.
  • You @use the fontsource mixins both in the comment examples and at the top of the file; consider centralizing the import once and referencing it consistently in examples to reduce duplication and potential divergence over time.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The SCSS `@use` paths reference `../../../node_modules/...`; if your build tooling supports it, prefer using package-based imports (e.g. `@use '@fontsource-utils/scss/src/mixins'`) to avoid brittle relative paths that may break if the directory structure changes.
- You `@use` the `fontsource` mixins both in the comment examples and at the top of the file; consider centralizing the import once and referencing it consistently in examples to reduce duplication and potential divergence over time.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@francoistibo
Copy link
Copy Markdown
Contributor

à présenter en réunion équipe theme dev du 20.04. je l'ai ajouté à l'ODJ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants